import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

// Notice, do not import com.mysql.jdbc.*
// or you will have problems!

public class ConnexionBDD {
    public static void main(String[] args) {
    	System.out.println("lol-2");
        try {
            // The newInstance() call is a work around for some
            // broken Java implementations

            Class.forName("com.mysql.jdbc.Driver").newInstance();
            
            System.out.println("lol-1");
            try {
            	System.out.println("lol0");
            	Connection conn = null;
            	if(conn==null){ System.out.println("lol1");}
                conn=DriverManager.getConnection("jdbc:mysql://localhost/etogomaranonce", "root", "");
                if(conn==null){ System.out.println("lol2");}
                if(!conn.isClosed())
                    System.out.println("Successfully connected to " +
                      "MySQL server using TCP/IP...");
                // Do something with the Connection
                System.out.println(conn);
            
            } catch (SQLException ex) {
                // handle any errors
                System.out.println("SQLException: " + ex.getMessage());
                System.out.println("SQLState: " + ex.getSQLState());
                System.out.println("VendorError: " + ex.getErrorCode());
            }
        } catch (Exception ex) {
        	System.out.println("Driver Exception: " + ex.getMessage());
        }
        
    }
}